#include "Discover.h"
#include "State.h"

bool Discover::findTarget(const Target::AntVector::value_type& ant, WeightTask& result)
{
    result.first = Location((rand()+state->rows/2)%state->rows,(rand()+state->cols/2)%state->cols);
    return true;
    /*
    direction = (direction + 1 ) % TDIRECTIONS;
    for (int d = 0; d < TDIRECTIONS; ++d)
    {
        result.first = state->getLocation(ant, (d+direction)%direction);

        if (state->grid[result.first.row][result.first.col].canMove())
            return true;
    }
    return false;
    */
}

void Discover::operator()(const Target::AntVector::value_type& ant)
{
    WeightTask task;
    if (findTarget(ant,task))
        assign(ant,task);
}
